<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/favicon.ico">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.ico">
  <link rel="mask-icon" href="/images/favicon.ico" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yoursite.com","root":"/","scheme":"Mist","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"always","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="静态网页生成工具，不需要数据库支持，可以配合第三方服务，如Disqus日志评论系统。可以部署到GitHub作为自己的博客">
<meta property="og:type" content="article">
<meta property="og:title" content="Jekyll-博客工具">
<meta property="og:url" content="http://yoursite.com/2018/07/15/tool-2018-07-15-Jekyll/index.html">
<meta property="og:site_name" content="Akiyama&#39;s Blog">
<meta property="og:description" content="静态网页生成工具，不需要数据库支持，可以配合第三方服务，如Disqus日志评论系统。可以部署到GitHub作为自己的博客">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://yoursite.com/images/Jekyll/jekyll01.png">
<meta property="og:image" content="http://yoursite.com/images/Jekyll/jekyll02.png">
<meta property="og:image" content="http://yoursite.com/images/Jekyll/jekyll03.png">
<meta property="og:image" content="http://yoursite.com/images/Jekyll/jekyll04.png">
<meta property="og:image" content="http://yoursite.com/images/Jekyll/jekyll05.png">
<meta property="og:image" content="http://yoursite.com/images/Jekyll/jekyll07.png">
<meta property="article:published_time" content="2018-07-14T16:00:00.000Z">
<meta property="article:modified_time" content="2021-05-16T10:05:14.348Z">
<meta property="article:author" content="丘山月夜">
<meta property="article:tag" content="工具">
<meta property="article:tag" content="笔记">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://yoursite.com/images/Jekyll/jekyll01.png">

<link rel="canonical" href="http://yoursite.com/2018/07/15/tool-2018-07-15-Jekyll/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Jekyll-博客工具 | Akiyama's Blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Akiyama's Blog</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">丘山月夜的博客</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="home fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="user fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="tags fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="th fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="archive fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/07/15/tool-2018-07-15-Jekyll/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.png">
      <meta itemprop="name" content="丘山月夜">
      <meta itemprop="description" content="君は空を見てるか,<br>風の音を聞いてるか">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Akiyama's Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Jekyll-博客工具
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2018-07-15 00:00:00" itemprop="dateCreated datePublished" datetime="2018-07-15T00:00:00+08:00">2018-07-15</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-05-16 18:05:14" itemprop="dateModified" datetime="2021-05-16T18:05:14+08:00">2021-05-16</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/" itemprop="url" rel="index"><span itemprop="name"></span></a>
                </span>
            </span>

          
            <div class="post-description">静态网页生成工具，不需要数据库支持，可以配合第三方服务，如Disqus日志评论系统。可以部署到GitHub作为自己的博客</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="目录结构"><a href="#目录结构" class="headerlink" title="目录结构"></a>目录结构</h2><ul>
<li>_config.yml：这个文件是为了保存配置的。也可用命令行配置</li>
<li>_includes：这里面的就是可以重复利用的文件。这个文件可以被其他的文件包含，重复利用。相当于网页的include，如header，footer等</li>
<li>_layout：存放网页的模板文件</li>
<li>_posts：存放具体的博客文章。文件必须为year-month-date-title.markup的格式。文件格式可以是md，html等、</li>
<li>_site：这个文件夹存放的是最终生成的文件。 编译器生成，建议放到.gitignore里</li>
</ul>
<p>Jekyll运行会遍历所有的文件，进行解析生成文件。</p>
<h2 id="安装环境"><a href="#安装环境" class="headerlink" title="安装环境"></a>安装环境</h2><p>将工程上传到GitHub上即可访问，但是每次写好博客都需要上传访问，太麻烦，可以先在本地调试。</p>
<p>本地调试需要安装环境：Ruby+Devkit+Jekyll</p>
<p>下载安装包不用配置环境变量。官方提供了ruby和devkit合成的安装包：<a target="_blank" rel="noopener" href="https://rubyinstaller.org/downloads/">下载地址</a></p>
<p><img src="/images/Jekyll/jekyll01.png" alt="jekyll01"></p>
<h3 id="安装步骤"><a href="#安装步骤" class="headerlink" title="安装步骤"></a>安装步骤</h3><ol>
<li>指定安装路径，勾选use UTF-8<br><img src="/images/Jekyll/jekyll02.png" alt="jekyll02"></li>
<li>勾选MSYS2<br><img src="/images/Jekyll/jekyll03.png" alt="jekyll03"></li>
<li>点击finish<br><img src="/images/Jekyll/jekyll04.png" alt="jekyll04"></li>
<li>自动弹出命令行，输入1，等待安装成功<br><img src="/images/Jekyll/jekyll05.png" alt="jekyll05"></li>
<li>安装jekyll：打开dos，输入gem install jekyll，等待安装完成</li>
<li>安装完成后输入jekyll -v，出现版本号说明安装成功</li>
<li>安装bundle：在dos中输入gem install bundle，等待安装完成</li>
<li>dos中切换到工程目录，执行jekyll serve或者jekyll build即可运行</li>
<li>浏览器中输入localhost:4000访问</li>
</ol>
<h2 id="运行过程中出错记录"><a href="#运行过程中出错记录" class="headerlink" title="运行过程中出错记录"></a>运行过程中出错记录</h2><ul>
<li><p>提示将_config.yml文件的gem:改成plugins:</p>
</li>
<li><p>提示缺少依赖，需要安装，根据具体情况安装，命令如下：</p>
<p>gem install jekyll-sitemap<br>gem install jekyll-seo-tag<br>gem install jekyll-feed</p>
</li>
<li><p>不允许出现中文名，可能出现下面的情况：</p>
<ol>
<li>运行起来之后访问不到文章：文章文件带中文名</li>
</ol>
<p>[2018-07-15 16:42:37] ERROR `/2018/07/15/ELK数据分析.html’ not found.</p>
<ol start="2">
<li>也可能在编译时就出错无法运行：检查是否有文件包含中文名</li>
</ol>
<p>Liquid Exception: Liquid error (line 13): invalid byte sequence in UTF-8 in sitemap.xml<br>​             Error: Liquid error (line 13): invalid byte sequence in UTF-8<br>​             Error: Run jekyll build –trace for more information.</p>
</li>
<li><p>如果博客文章中出现jekyll的语法，也会被解析，可能会导致报错：</p>
<p>在文章中使用了这一句，jekyll进行了解析</p>
<p><img src="/images/Jekyll/jekyll07.png" alt="jekyll07"></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Liquid Exception: Could not locate the included file &#39;file.ext&#39; in any of</span><br><span class="line">[&quot;E:&#x2F;GitPageBlog&#x2F;moon-lights.github.io&#x2F;includes&quot;]. Ensure it exists in one of those directories </span><br><span class="line">and, if it is a symlink, does not point outside your site source. in E:&#x2F;GitPageBlog&#x2F;moon-</span><br><span class="line">lights.github.io&#x2F;posts&#x2F;tool&#x2F;2018-7-15-Jekyll.md</span><br></pre></td></tr></table></figure></li>
</ul>
<h2 id="参考教程："><a href="#参考教程：" class="headerlink" title="参考教程："></a>参考教程：</h2><p><a target="_blank" rel="noopener" href="https://www.cnblogs.com/zjjDaily/p/8695978.html">使用Github pages+jekyll搭建自己的博客（windows版）</a></p>
<p><a target="_blank" rel="noopener" href="https://www.jianshu.com/p/ffbbed22f984">Jekyll使用篇 1 - 发布文章、加入评论功能、加入Google Analytics</a></p>
<h2 id="相关文章："><a href="#相关文章：" class="headerlink" title="相关文章："></a>相关文章：</h2><p><a target="_blank" rel="noopener" href="http://wiki.jikexueyuan.com/project/jekyll/">Jekyll教程_Jekyll开发中文手册[PDF]下载-极客学院Wiki</a></p>
<p><a target="_blank" rel="noopener" href="http://ju.outofmemory.cn/entry/98471">Jekyll 语法简单笔记</a></p>
<p><a target="_blank" rel="noopener" href="https://www.jekyll.com.cn/docs/home/">Jekyll官网</a></p>

    </div>

    
    
    
        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item">
          <a target="_blank" class="social-link" href="/images/wechat_channel.jpg">
            <span class="icon">
              <i class="fab fa-weixin"></i>
            </span>

            <span class="label">WeChat</span>
          </a>
        </div>
    </div>
  </div>


      <footer class="post-footer">
          
          <div class="post-tags">
              <a href="/" rel="tag"><i class="fa fa-tag"></i> </a>
              <a href="/" rel="tag"><i class="fa fa-tag"></i> </a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2018/07/15/tool-2018-07-15-ELK/" rel="prev" title="ElasticSearch+Logstash+Kibana">
      <i class="fa fa-chevron-left"></i> ElasticSearch+Logstash+Kibana
    </a></div>
      <div class="post-nav-item">
    <a href="/2018/07/23/tech-2018-07-23-JavaNetBase-Mina/" rel="next" title="网络编程和Mina入门">
      网络编程和Mina入门 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="header-overlay"></div>
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84"><span class="nav-number">1.</span> <span class="nav-text">目录结构</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AE%89%E8%A3%85%E7%8E%AF%E5%A2%83"><span class="nav-number">2.</span> <span class="nav-text">安装环境</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AE%89%E8%A3%85%E6%AD%A5%E9%AA%A4"><span class="nav-number">2.1.</span> <span class="nav-text">安装步骤</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%BF%90%E8%A1%8C%E8%BF%87%E7%A8%8B%E4%B8%AD%E5%87%BA%E9%94%99%E8%AE%B0%E5%BD%95"><span class="nav-number">3.</span> <span class="nav-text">运行过程中出错记录</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%8F%82%E8%80%83%E6%95%99%E7%A8%8B%EF%BC%9A"><span class="nav-number">4.</span> <span class="nav-text">参考教程：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%9B%B8%E5%85%B3%E6%96%87%E7%AB%A0%EF%BC%9A"><span class="nav-number">5.</span> <span class="nav-text">相关文章：</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="丘山月夜"
      src="/images/avatar.png">
  <p class="site-author-name" itemprop="name">丘山月夜</p>
  <div class="site-description" itemprop="description">君は空を見てるか,<br>風の音を聞いてるか</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">60</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">14</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">21</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">丘山月夜</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://mist.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Mist</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
